#!/usr/bin/env node
const Dog = require('./02-dog.js')

var taidi = new Dog('taidi',5);
var zangao = new Dog('zangao',7);

taidi.on('bark',onBark);
zangao.on('bark',onBark);

function onBark(){
  console.log(`name:${this.name},energy:${this.energy}`);
}

